Repository navigation
feat(id): parameterise web adapter binding from [interfaces.web] (#2325) - #3894
Conversation
Phase 4 of the #2028 ID core v1 synthesis (#2026 design section 4.1): the web adapter binding stops being hardcoded to one world. - New web/app_interface.rs: WebInterface + WebMode parsed from an app.toml [interfaces.web] section (mode adapter|direct, route, optional socket), with WebInterface::world_app() naming the historical binding (adapter, /world, /ws/world). Folder discovery stays #2324; this is the binding layer it will feed. - world_ws::world_routes_at(socket): the session bridge with its live channel bound per app; world_routes() delegates at /ws/world, unchanged. - routes::create_router_for_app(state, interface): world page at the app route, bridge merged at the app socket; create_router delegates with world_app() and is byte-identical (same routes, handlers, layer order, state). Tests: app_interface parse tests (custom binding, in-section defaults, absent section, direct mode, unknown mode) and world_ws two_apps_bind_distinct_sockets - two apps handshaking on their own sockets and refusing each other's. Crate verification runs in CI on the PR (fresh-worktree cold build exceeds the shift budget on a loaded laptop).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2eb0074bce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ocket to the frontend, configured route on the home page, shared HTTP routes without a socket (#2325) Dispositions the three Codex findings on 2eb0074 (PR #3894): - P1: the world page renderer now carries the app socket as data-world-socket on the root element and world.ts connects join/upload/compile to it (historical /ws/world stays the default when no attribute is rendered). - P2: render_home takes the app page route; explorer links and the global-chat iframe use it instead of hardcoded /world. - P2: world_routes_at is split - world_http_routes() serves the shared HTTP surface (invite, metrics, directory, explore) and create_router_for_app merges it even when the app declares no socket; only the websocket bridge is socket-bound. AppState carries the binding (web_route/web_socket, world-app defaults); create_router_for_app stamps it from the interface. Tests: http_routes_serve_without_a_socket (metrics 401 not 404, explore 200), home custom-route assertions, world page socket attribute assertion. cargo check -p id --lib passes, cargo fmt clean; full suites run in CI (the id-core lib-test target fails to compile on this base for an unrelated missing vt100 dev dependency - pre-existing, untouched by this change).
|
New head Record correction: this PR is queue task 5772's own PR (see its body) — the intervening "Drew-owned hard stop" parks rested on author == Local verification: Queue task 5772 parked on CI + this re-review; will resume, verify, and merge when both are green/clean. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39a4d65052
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Re-export create_router_for_app and the app_interface manifest types (WebInterface, WebMode, WebInterfaceError, web_interface_from_app_toml) from id::web, so a host that has read its app.toml can select the [interfaces.web] binding through the public API instead of create_router always forcing the world app binding. Fixes the Codex P2 on PR #3894. New upload_router_tests::public_entry_point_honours_a_configured_binding builds an /arena router purely via crate::web paths and asserts /arena serves while /world 404s.
|
🤖 Agent note · parked
|
Phase 4 of the #2028 ID core v1 synthesis — the #2026 design §4.1 work: the web adapter binding stops being hardcoded to one world and reads route/socket from the app's
app.toml[interfaces.web]section (mode=adapter).What
pkgs/id/src/web/app_interface.rs—WebInterface/WebModeandweb_interface_from_app_toml: parses[interfaces.web](mode= adapter|direct,route, optionalsocket) out of an app.toml document. Absent section →None(a pure CLI app is valid, id: investigate: app packaging — apps as folders (code + resources), TUI/web interface parity, web-native specialization #2026 §2); unknown mode is an error.WebInterface::world_app()names the historical binding (adapter,/world,/ws/world). Folder discovery / reading app.toml from disk stays with id: PoC: package tic-tac-toe as the first apps/ folder — app.toml + host discovery #2324 — this is the binding layer it feeds.world_ws::world_routes_at(socket)— the world session bridge with its live channel bound per app;world_routes()delegates at/ws/world, unchanged. All other routes (invite, metrics, directory, explore) are the shared API surface, unchanged.routes::create_router_for_app(state, &interface)— the main router with the world page bound at the app's route and the bridge merged at the app's socket (merge still happens before the body-limit layer and state, exactly as today).create_routerdelegates withworld_app(), so the existing world app is byte-identical: same routes, handlers, layer order, state.Direct-for-web mode (§4.2) is parsed but not bound here, per the packet's exclusions; the pack step (§5) is untouched.
Tests
app_interfaceparse tests: custom adapter binding, in-section defaults, absent section, direct mode, unknown mode rejected.world_ws::two_apps_bind_distinct_sockets: two apps served side by side — each answers a websocket handshake on its own socket (/ws/world,/ws/arena) and refuses the other's.Crate-level verification runs in CI on this PR: a fresh worktree's cold cargo build could not finish inside the worker shift budget on the (heavily loaded) laptop, so the queue task is parked on the CI result + Codex review rather than claiming local verification it did not get.
Queue: task 5772 (repo-health-code-pilot), lane A.
Closes #2325
Need help on this PR? Tag
@codesmith-botwith what you need.